<#assign ctx=request.contextPath />
<#import '${ctx}/sys/include/head.html' as d/>
<!DOCTYPE html>
<html>
<head>
<@d.head title="table" />
</head>
<body>
<div class="layui-container" style="margin-top:12px;">
	<div class="layui-row">
		<div class="layui-form">
			<div class="layui-form-item">
				<label class="layui-form-label">查询条件</label>
				<div class="layui-input-block">
					<input type="text" id="search_text" placeholder="查询" autocomplete="off"
						class="layui-input">
					<input type="hidden" id="parent_name"/>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<table class="layui-hide" id="dw_s_table" lay-filter="search_table">
				</table>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<a class="layui-btn" id="check_btn">确定</a>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script>
layui.use(['table','form','appJs'],function(){
	var table = layui.table;
	var $ = layui.$;

	var tableOptions = {
		  	id:'search_table'
			    ,elem: '#dw_s_table'
			    //,height: 420
			    ,url: '${ctx}/biz/data/ds/query_ds_list' //数据接口
			    ,title: '角色表'
			    ,cols: [[ //表头
			      {type: 'radio', fixed: 'left'}
			      ,{field: 'name',width:300, title: '表名'}
			      ,{field: 'path', title: '路径'}
			      ,{field: 'comment', title: '说明'}
			    ]]
			  };
	table.render(tableOptions);
	var inputDelay;
	$("#search_text").bind('input',function(){
		clearTimeout(inputDelay);
		inputDelay = setTimeout(function(){
		    var uname = $("#search_text").val();
		    tableOptions.where={
		    		search_field : "name",
		    		search_value : uname
		    }
		    table.render(tableOptions);
		},500);
	});
});
</script>

